package cn.thr.pethome.role.mapper;

import cn.thr.pethome.menu.domain.Menu;
import cn.thr.pethome.permission.domain.Permission;
import cn.thr.pethome.role.domain.Role;
import cn.thr.pethome.base.mapper.BaseMapper;
import cn.thr.pethome.role.domain.RoleMenu;
import cn.thr.pethome.role.domain.RolePermission;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author thr
 * @since 2023-02-01
 */
@Repository
public interface RoleMapper extends BaseMapper<Role> {
    void addByMenu(RoleMenu roleMenu);
    void addByPermission(RolePermission rolePermission);
    //返回修改回显菜单
    List<Menu> getMenusByRoleId(Long id);

    //返回修改回显权限
    List<Permission> getPermissionByRoleId(Long id);
    //用来角色删除的
    void  delMenus(Long id);

    void  delPermission(Long id);
    //通过t_role_permission   role_id 去查询 t_permission中间表的id  只需要中间表的url
    List<String> getPermissionsByRoleIds(List<Long> ids);

}
